home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / xpcom / nsIInterfaceRequestor.h < prev    next >
C/C++ Source or Header  |  2006-05-08  |  4KB  |  113 lines

  1. /*
  2.  * DO NOT EDIT.  THIS FILE IS GENERATED FROM nsIInterfaceRequestor.idl
  3.  */
  4.  
  5. #ifndef __gen_nsIInterfaceRequestor_h__
  6. #define __gen_nsIInterfaceRequestor_h__
  7.  
  8.  
  9. #ifndef __gen_nsISupports_h__
  10. #include "nsISupports.h"
  11. #endif
  12.  
  13. /* For IDL files that don't want to include root IDL files. */
  14. #ifndef NS_NO_VTABLE
  15. #define NS_NO_VTABLE
  16. #endif
  17.  
  18. /* starting interface:    nsIInterfaceRequestor */
  19. #define NS_IINTERFACEREQUESTOR_IID_STR "033a1470-8b2a-11d3-af88-00a024ffc08c"
  20.  
  21. #define NS_IINTERFACEREQUESTOR_IID \
  22.   {0x033a1470, 0x8b2a, 0x11d3, \
  23.     { 0xaf, 0x88, 0x00, 0xa0, 0x24, 0xff, 0xc0, 0x8c }}
  24.  
  25. /**
  26.  * The nsIInterfaceRequestor interface defines a generic interface for 
  27.  * requesting interfaces that a given object might provide access to.
  28.  * This is very similar to QueryInterface found in nsISupports.  
  29.  * The main difference is that interfaces returned from GetInterface()
  30.  * are not required to provide a way back to the object implementing this 
  31.  * interface.  The semantics of QI() dictate that given an interface A that 
  32.  * you QI() on to get to interface B, you must be able to QI on B to get back 
  33.  * to A.  This interface however allows you to obtain an interface C from A 
  34.  * that may or most likely will not have the ability to get back to A. 
  35.  *
  36.  * @status FROZEN
  37.  */
  38. class NS_NO_VTABLE nsIInterfaceRequestor : public nsISupports {
  39.  public: 
  40.  
  41.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_IINTERFACEREQUESTOR_IID)
  42.  
  43.   /**
  44.     * Retrieves the specified interface pointer.
  45.     *
  46.     * @param uuid The IID of the interface being requested.
  47.     * @param result [out] The interface pointer to be filled in if
  48.     *               the interface is accessible.
  49.     * @return NS_OK - interface was successfully returned.
  50.     *         NS_NOINTERFACE - interface not accessible.
  51.     *         NS_ERROR* - method failure.
  52.     */
  53.   /* void getInterface (in nsIIDRef uuid, [iid_is (uuid), retval] out nsQIResult result); */
  54.   NS_IMETHOD GetInterface(const nsIID & uuid, void * *result) = 0;
  55.  
  56. };
  57.  
  58. /* Use this macro when declaring classes that implement this interface. */
  59. #define NS_DECL_NSIINTERFACEREQUESTOR \
  60.   NS_IMETHOD GetInterface(const nsIID & uuid, void * *result); 
  61.  
  62. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  63. #define NS_FORWARD_NSIINTERFACEREQUESTOR(_to) \
  64.   NS_IMETHOD GetInterface(const nsIID & uuid, void * *result) { return _to GetInterface(uuid, result); } 
  65.  
  66. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  67. #define NS_FORWARD_SAFE_NSIINTERFACEREQUESTOR(_to) \
  68.   NS_IMETHOD GetInterface(const nsIID & uuid, void * *result) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetInterface(uuid, result); } 
  69.  
  70. #if 0
  71. /* Use the code below as a template for the implementation class for this interface. */
  72.  
  73. /* Header file */
  74. class nsInterfaceRequestor : public nsIInterfaceRequestor
  75. {
  76. public:
  77.   NS_DECL_ISUPPORTS
  78.   NS_DECL_NSIINTERFACEREQUESTOR
  79.  
  80.   nsInterfaceRequestor();
  81.  
  82. private:
  83.   ~nsInterfaceRequestor();
  84.  
  85. protected:
  86.   /* additional members */
  87. };
  88.  
  89. /* Implementation file */
  90. NS_IMPL_ISUPPORTS1(nsInterfaceRequestor, nsIInterfaceRequestor)
  91.  
  92. nsInterfaceRequestor::nsInterfaceRequestor()
  93. {
  94.   /* member initializers and constructor code */
  95. }
  96.  
  97. nsInterfaceRequestor::~nsInterfaceRequestor()
  98. {
  99.   /* destructor code */
  100. }
  101.  
  102. /* void getInterface (in nsIIDRef uuid, [iid_is (uuid), retval] out nsQIResult result); */
  103. NS_IMETHODIMP nsInterfaceRequestor::GetInterface(const nsIID & uuid, void * *result)
  104. {
  105.     return NS_ERROR_NOT_IMPLEMENTED;
  106. }
  107.  
  108. /* End of implementation class template. */
  109. #endif
  110.  
  111.  
  112. #endif /* __gen_nsIInterfaceRequestor_h__ */
  113.